home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-13 | 2.9 KB | 81 lines | [TEXT/MPS ] |
- (******************************************************************************
- *
- * Apple Macintosh Developer Technical Support
- *
- * Interfaces for feature determination
- *
- * Program: Sample 3.0
- * FILE: Features.p - Pascal implementation
- *
- * by: Matt Deatherage
- *
- * Copyright © 1988-1993 Apple Computer, Inc.
- * All rights reserved.
- *
- *******************************************************************************
- *
- * This unit, the "Features" unit, includes the compatibility information we
- * need to run with. Before using several features of the Macintosh operating
- * system or toolbox, it's wise programming practice to insure they actually
- * exist. "Wise" means "If you call something that's not there, it's gonna
- * crash."
- *
- * There's a few nifty routines provided by the System Software to help with
- * all this, and we collect most of them into this unit to keep the code a
- * bit cleaner. The major call to the unit is "DetermineFeatures", which
- * makes sure everything we need to examine the features we want is present
- * -- mostly Gestalt. The same call also is a convenient place to set any
- * global variables we have that we want to use throughout the program.
- * Rather than call Gestalt every time we need to check for color QuickDraw,
- * we check for it in DetermineFeatures and keep it in a global
- * variable. This is easy to extend to include all the things you want to
- * check for.
- *
- * Sample calls DetermineFeatures from Initialize.
- *
- ******************************************************************************)
-
- UNIT Features;
-
- INTERFACE
-
- (*******************************************************************************
- * Used Units
- *******************************************************************************)
-
- USES GestaltEqu, OSUtils, Resources;
-
- (*******************************************************************************
- * Global variables maintained by this unit
- *******************************************************************************)
-
- VAR
- gHasGestalt, { TRUE if Gestalt is implemented }
- gHasHelpMgr, { TRUE if the Help Manager is present }
- gHasColorQD, { TRUE if color QuickDraw is present }
- gHas32BitQD, { TRUE if 32-Bit QuickDraw is installed }
- gHasFindFolder, { TRUE if FindFolder is available }
- gHasDeviceLoop, { TRUE if the DeviceLoop trap is implemented }
- gHasAppleEvents: BOOLEAN; { TRUE if the Apple Event Manager is present }
-
- gAppsResourceFile: INTEGER; { the resource file number of our application
- file }
-
- (*******************************************************************************
- *
- * DetermineFeatures - figure out what system features are present
- *
- * This routine examines the system and sets global variables listed above
- * to indicate what system features are present, if we're interested at
- * all.
- *
- *******************************************************************************)
-
- FUNCTION DetermineFeatures: BOOLEAN;
-
- IMPLEMENTATION
-
- {$I Features.inc1.p}
-
- END. { unit Features }
-